﻿@using PagedList.Mvc;
@{
    PagedList.IPagedList<Model.Sys.Sys_RoleModel> myPageList = (PagedList.IPagedList<Model.Sys.Sys_RoleModel>)ViewBag.MyPageList;
    Layout = "~/Views/Shared/MyLayOutNew.cshtml";
}
<main class="main-cont content mCustomScrollbar">
    <div class="page-wrap">
        <!--开始::内容-->
        <section class="page-hd">
            <header>
                <h2 class="title">系统管理>>角色管理</h2>
                <p class="title-description">
                    <button class="btn btn-primary" onclick="Edit('add','0');">新增</button>
                </p>
            </header>
            <hr>
        </section>
        <table class="table mb-15">
            <thead>
                <tr>
                    <th><input type="checkbox" /></th>
                    <th>角色名称</th>
                    @*<th>角色类型</th>*@
                    @*<th>关联机构类型</th>*@
                    <th>创建时间</th>
                    <th>备注</th>
                    <th>操作</th>
                 
                </tr>
            </thead>
            <tbody>

                @foreach (var item in myPageList)
                {
                    <tr class="cen">
                        <td><input type="checkbox" /></td>
                        <td>
                            @Html.DisplayFor(modelItem => item.RoleName)

                        </td>
                        @*<td>
                            @Html.DisplayFor(modelItem => item.RoleType)
                        </td>*@
                        @*<td>
                            @Html.DisplayFor(modelItem => item.OrganizationTypes)
                        </td>*@

                        <td>
                            @Html.DisplayFor(modelItem => item.CreateDate)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Remark)
                        </td>

                        <td>
                            <a title="编辑" class="mr-5" onclick="Edit(@item.ID);">编辑</a>

                        </td>
                    </tr>
                }

            </tbody>
        </table>
        每页 @myPageList.PageSize 条记录，共 @myPageList.PageCount 页，当前第 @myPageList.PageNumber 页
        @Html.PagedListPager(myPageList, page => Url.Action("Index", new { page }))
        <!--开始::结束-->
    </div>
</main>
<script type="text/javascript">
    function Edit(id) {
        window.location.href = "/SysRole/Edit?id=" + id;
    }
</script>